//
//  HYQWebView.h
//  HYQWebkit_Example
//
//  Created by zhuxingjian on 2018/8/20.
//  Copyright © 2018年 zxj1989. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HYQBaseBridgeManager.h"

@class HYQWebView;

typedef BOOL(^WebViewShouldStartLoadBlock)(HYQWebView *webView, NSURLRequest *request);
typedef void(^WebViewDidStartLoadBlock)(HYQWebView *webView);
typedef void(^WebViewDidFinishLoadBlock)(HYQWebView *webView);
typedef void(^WebViewDidFailLoadBlock)(HYQWebView *webView, NSError *error);

@interface HYQWebView : UIWebView

- (instancetype)initWithBridgeManager:(HYQBaseBridgeManager *)bridgeManager;

- (void)loadWebViewWithURLString:(NSString *)urlString;

@property (nonatomic, copy) WebViewShouldStartLoadBlock shouldStartLoadBlock;
@property (nonatomic, copy) WebViewDidStartLoadBlock didStartLoadBlock;
@property (nonatomic, copy) WebViewDidFinishLoadBlock didFinishLoadBlock;
@property (nonatomic, copy) WebViewDidFailLoadBlock didFailLoadBlock;

- (void)callJSWithName:(NSString *)functionName param:(id)param;

@end
